﻿using System;

namespace SublightPlugin.Test
{
    class TestRunner
    {
        public static bool Run(Type typeOfTest)
        {
            if (typeOfTest == null) throw new Exception("Missing argument: typeOfTest");
            var instance = typeOfTest.Assembly.CreateInstance(typeOfTest.FullName) as ITest;
            if (instance == null) throw new Exception("Could not create instance of ITest");

            return instance.Run();
        }
    }
}
